package com.deepoove.swagger.dubbo.example.provider;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.deepoove.swagger.dubbo.example.api.pojo.Person;
import com.deepoove.swagger.dubbo.example.api.pojo.User;
import com.deepoove.swagger.dubbo.example.api.service.AccountService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(value = "帐号服务")
@Service
public class AccountServiceImpl implements AccountService {
	@Value("${swagger.dubbo.http}")
	private  String  fString;
	
	@Override
	@ApiOperation(value = "登出", notes = "退出用户信息")
	public User logout(String account) {
		
		User sUser=new User();
		sUser.setId("132");
		sUser.setName("zdwefer");
		return sUser;
		
	}

	@Override
	@ApiOperation(value = "登录")
	public boolean login(@ApiParam(value = "用户帐号") String account,
			@ApiParam(value = "用户密码") String password) {
		return false;
	}

	@Override
	@ApiOperation(nickname="byCode", value = "登录", notes="邀请码登录")
	public boolean login(@ApiParam(value = "用户帐号") String account, @ApiParam(value = "邀请码") int code) {
		return false;
	}

	@Override
	public void updateInfo(boolean isBoy, Integer number) {
	}

	@Override
	@ApiOperation(value = "获取用户的List")
	public List<User> getUserList(@ApiParam(value = "用户对象")User u, @ApiParam(value = "人对象")Person p) {
		if(p==null) p=new Person();
		System.out.println(p.getUser().getName());
		List<User> list=new ArrayList<User>();
		User user=new User();
		user.setId("1");
		user.setName("zsw");
		user.setSite("www.wangmenghua.com");
		User user2=new User();
		user2.setId("2");
		user2.setName("zsw2");
		user2.setSite("www.wangmenghuaAnd曾少文.com");
		list.add(user2);
		return list;
	}

}
